package org.flashamaphone.voices.waveformFactories
{
	import flash.utils.ByteArray;
	
	/** Interface for waveform generators */
	public interface IWaveFactory
	{
		/** 
		 * getter for last sample index - helpful for ensuring seamless stitchin of sounds
		 * 
		 * @return index
		 */
		function get lastSampleIndex():int;
		
		/** 
		 * get a sample at a specific phase of a cycle
		 * 
		 * @return index
		 */
		function sample(phase:Number):Number;
		
		/** 
		 * get the byte array from a complete cycle
		 * 
		 * @param frequency
		 * @param number of samples
		 * @param offset
		 * @param envelope multiplier (amplitude)
		 * @return byte array of cycle
		 */
		function cycle(freq:Number, length:int, offset:int = 0, envelopeStart:Number = 1, envelopeEnd:Number = 1):ByteArray;
	}
}